<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type=text/javascript src="/zTree_v3/js/jquery.min.js"></script>
<script type="text/javascript" src="/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
		
		<script type=text/javascript>
var setting = { 
	view: { 
		showLine: true 
	}, 
	data: { 
		simpleData: { 
			enable: true 
		} 
	} 
}; 

var zNodes =[
	{ id:1, pId:0, name:"父節點1 - 展開", open:true},
	{ id:11, pId:1, name:"父節點11 - 摺疊"},
	{ id:111, pId:11, name:"葉子節點111"},
	{ id:112, pId:11, name:"葉子節點112"},
	{ id:113, pId:11, name:"葉子節點113"},
	{ id:114, pId:11, name:"葉子節點114"},
	{ id:12, pId:1, name:"父節點12 - 摺疊"},
	{ id:121, pId:12, name:"葉子節點121"},
	{ id:122, pId:12, name:"葉子節點122"},
	{ id:123, pId:12, name:"葉子節點123"},
	{ id:124, pId:12, name:"葉子節點124"},
	{ id:13, pId:1, name:"父節點13 - 沒有子節點", isParent:true},
	{ id:2, pId:0, name:"父節點2 - 摺疊"},
	{ id:21, pId:2, name:"父節點21 - 展開", open:true},
	{ id:211, pId:21, name:"葉子節點211"},
	{ id:212, pId:21, name:"葉子節點212"},
	{ id:213, pId:21, name:"葉子節點213"},
	{ id:214, pId:21, name:"葉子節點214"},
	{ id:22, pId:2, name:"父節點22 - 摺疊"},
	{ id:221, pId:22, name:"葉子節點221"},
	{ id:222, pId:22, name:"葉子節點222"},
	{ id:223, pId:22, name:"葉子節點223"},
	{ id:224, pId:22, name:"葉子節點224"},
	{ id:23, pId:2, name:"父節點23 - 摺疊"},
	{ id:231, pId:23, name:"葉子節點231"},
	{ id:232, pId:23, name:"葉子節點232"},
	{ id:233, pId:23, name:"葉子節點233"},
	{ id:234, pId:23, name:"葉子節點234"},
	{ id:3, pId:0, name:"父節點3 - 沒有子節點", isParent:true}
];


$(document).ready(function(){
var $user1 = $('#user1').val();
	$.ajax({
		type: "post",
		dataType : "json",
		global : false,
		url : "/huihuang2016.php/Home/Common/getTree",
		data : {
		user1 : $user1
		},
		success : function(data, textStatus) {
			if (data.status == 0)
			{
				zNodes1 = data.data;
				$.fn.zTree.init($("#treeDemo"), setting, zNodes1);
			} else {
				//alert("您還沒有");
			}
			
			return ;
		}
		
	});
	
	//$.fn.zTree.init($("#treeDemo"), setting, zNodes);
});



$(function(){



$('#btn').click(function(){

var $user = $('#user').val();
$.ajax({
		type: "post",
		dataType : "json",
		global : false,

		url : "/huihuang2016.php/Home/Common/getTreeso",
		data : {
		user : $user
		},
		success : function(data, textStatus) {
			if (data.status == 0)
			{
			//alert(data.nr);
			
				zNodes1 = data.data;
				$.fn.zTree.init($("#treeDemo"), setting, zNodes1);
			} else {
				alert(data.data);
			}
			
			return ;
		}
		
	});



})


})




</script>
</head>

<body>
<div class="formbody">
    
    <div class="core_con">
	<div style="font-size:9pt;"><form action="" method="get"><input name="user1" id="user1"  type="hidden" value="<?php echo ($user); ?>" />會員賬號 : <input id="user" name="user" type="text"> <input name="" type="button" id="btn" value="搜索">
	<span id="daishu"></span></form></div>
    <div class="content_wrap">
	<div class="zTreeDemoBackground ">
		<ul id="treeDemo" class="ztree"></ul>
	</div>
	<!-- <div class="right">
		<ul class="info">
			<li class="title"><h2>1、setting 配置信息說明</h2>
				<ul class="list">
				<li class="highlight_red">是否顯示連接線請設置 setting.view.showLine 屬性，詳細請參見 API 文檔中的相關內容</li>
				</ul>
			</li>
			<li class="title"><h2>2、treeNode 節點數據說明</h2>
				<ul class="list">
				<li>是否顯示連線，不需要 treeNode 節點數據提供特殊設置</li>
				</ul>
			</li>
		</ul>
	</div> -->
</div>
	</div>
    
    </div>


</body>

</html>